Add Two Numbers: Workflow

This tutorial describes a very simple web application that adds two numbers together and displays the result. The addition logic is implemented by a three-node workflow detailed in this topic.

Note | Before being able to save a workflow, you need to have created at least one workflow category to assign the workflow to. See Workflow categories.

Creating a new workflow

To create the new workflow:

  1. On the portal home page click the Create New Workflow tile. Alternatively, click Workflow > Workflow on the main menu and then click Create on the WorkflowManagement menu.
  2. The Workflow Studio application launches.
  3. Login to Workflow Studio with your portal credentials.
  4. The default workflow comprises a Sequential Service node containing a ReceiveRequest node to input data, and a SendResponse node to output data.

ReceiveRequest node configuration

Warning | Use only alphanumeric characters when configuring parameters in a workflow.

  1. In the ReceiveRequest node, next to Content, click View parameter.
  2. In the Parameters list, click Add new parameter. Notice that there are already three system parameters in the list; TraceValue, FSIUserId, and TraceWorkflowId.
    1. Add a parameter with Name: WfInput1, Type: int32, Assign to: number1.
    2. Add a parameter with Name: WfInput2, Type: int32, Assign to: number2.

  3. Now define the parameter variables; select the ReceiveRequest node.
  4. Click Variables at the bottom left of the workflow area.
  5. In the Variables list, click Create variable and add three variables:
    1. number1, and number2, of type int32.
    2. outParam of type Object. This variable is used later in the configuration.
  6. Click Variables a second time to close the list.

Adding a Number Function node

This node will perform the number addition.

  1. Drag a Number Function node from the Custom Nodes section of the Toolbox and drop it onto the Sequential Service node between the ReceiveRequest and SendResponse nodes.
  2. Choose Addition in the Choose Formula list.
    1. Type number1 into the Enter 1st Value field.
    2. Type number2 into the Enter 2nd Value field.
    3. In the Number Function Properties list, type outParam into the Result field.


SendResponse node configuration

  1. In the SendResponse node, click in the Content field.
  2. Select the Parameters section, and click Add new parameter.
  3. Add a parameter with Name: MyResult, Type: Object, and Value: outParam.


  4. Click File > Save & Publish. In the pop-up, type a name for the workflow and select a category for it. This example uses the workflow name Adding2Numbers.
  5. The workflow should now appear in the portal Workflow Management list, showing a status of Published.

The following screenshot illustrates the completed workflow.

Now create the web application page: Add Two Numbers: Web Application.